#include "chooselevel.h"
#include "a_small_play.h"
#include "ui_chooselevel.h"
#include <QPushButton>


chooselevel::chooselevel(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::chooselevel)
{
    ui->setupUi(this);
    this->setGeometry(QRect(350,180,853,550));
    setFixedSize(853,550);//固定窗口大小
    d1=new Day;
    n1=new Night;

    QPushButton *btn11=new QPushButton("Night",this);
    btn11->setParent(this);
    btn11->resize(200,50);
    btn11->move(130,400);

    connect(btn11,&QPushButton::clicked,this,[=](){
        n1->show();
    });//设置切换到夜间模式的动作

    QPushButton *btn12=new QPushButton("Day",this);
    btn12->setParent(this);
    btn12->resize(200,50);
    btn12->move(523,400);

    connect(btn12,&QPushButton::clicked,this,[=](){
        d1->show();
    });//设置切换到日间模式的动作

    QPushButton *btn13=new QPushButton("Back",this);
    btn13->setParent(this);
    btn13->resize(160,40);
    btn13->move(673,10);

    connect(btn13,&QPushButton::clicked,this,[=](){
        this->close();
        emit backp();
    });//设置切换回初始界面的动作

}


void chooselevel::paintEvent(QPaintEvent *)
{
    QPainter painter(this);
    painter.drawPixmap(0,0,853,550,QPixmap(":/images/images/8.jpg"));
}


chooselevel::~chooselevel()
{
    delete ui;
}
